CommUpgrade = {}
CommUpgrade.DEBUG = false
CommUpgrade.List = {}
CommUpgrade.ListUniqueName = {}

function CommUpgrade:Add( tbl )

	local id = table.insert( self.List, tbl )
	
	tbl.Id = id 
	self.ListUniqueName[ tbl.UniqueName ] = id

end

function CommUpgrade:IdByUniqueName( name )
	return CommUpgrade.ListUniqueName[ id ]
end

function CommUpgrade:Get( id )

	if type( id ) == "string" then
		id = self:IdByUniqueName( name )
		
		if id == nil then
			return
		end
	end
	
	return self.List[ id ]
	
end